<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
  width: 100%;
  height: 500px;
  background-color: #6495ed;
  position: relative;
}

.box div {
  width: 303px;
  height: 301px;
  background-image: url(./老胡来也_23级H5CSS3练习_files/20231017211318.png);
  position: absolute;
  left: 50%;
  margin: 50px -150px;
  transition: all 2s;
  backface-visibility: hidden;
}

.d1 {
  background-position: 303px 0;
  transform: rotateY(180deg);
}

.d2 {
  background-position: 0 0;
}

.box:hover .d1 {
  transform: rotateY(0deg);
}

.box:hover .d2 {
  transform: rotateY(180deg);
}
    </style>
</head>
<body>
    <div class="box">
        <div class="d1"></div>
        <div class="d2"></div>

    </div>
</body>
</html>